package IO流;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;

public class TestRandom {

	public static void main(String[] args) {
		File f = new File("C:\\Users\\User\\Desktop\\22.txt");
		try {
			RandomAccessFile r = new RandomAccessFile(f, "rw");
			
			r.writeInt(23);//4
			r.writeDouble(1.2);//8
			r.seek(4);
			System.out.println(r.readDouble());;
			r.close();
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}
